package com.HomeWorkhsp.Chapter07;

import static java.lang.Math.*;

/**
 * Enjoy programming!!!
 * Time: 2021/11/9 -  20:42
 */
public class Test05 {
    public static void main(String[] args) {
        Cale c = new Cale();
        System.out.println(c.Difference(4.5, 6.7));
        System.out.println(c.Sum(4.5, 6.7));
        System.out.println(c.Quotient(4.5, 6.7));
        System.out.println(c.multiplication(4.5, 6.7));
    }
}

class Cale {
    public double Sum(double a, double b) {
        return a + b;
    }

    public double Difference(double a, double b) {
        return max(a, b) - min(a, b);
    }

    public double Quotient(double a, double b) {
        if (0 == b) {
            System.out.println("除数不能为零");
            return -1;
        }
        return a / b;
    }

    public double multiplication(double a, double b) {
        return a * b;
    }

}
